package both.map;

import java.awt.Color;

/**
 * The types of terrain available. Stores a String name
 * and default image filepath.
 * 
 * @author jdl
 */
public enum TerrainType {
	
	empty("nothing", "images/empty.png", Color.BLACK),
	stoneFloor("stone floor", "images/stone-floor.png", Color.GRAY), 
	stoneWall("stone wall", "images/stone-wall.png", Color.DARK_GRAY), 
	grass("grass", "images/grass.png", Color.GREEN), 
	dirt("dirt", "images/dirt.png", new Color(100,50,0)),
	cobble("cobbled street", "images/cobblestreet.png", Color.GRAY),
	sand("sand", "images/gravel-or-sand.png", new Color(210,210,165)),
	gravel("gravel", "images/gravel-or-sand.png", new Color(180,180,150)),
	mud("mud", "images/mud.png", new Color(115,90,75)),
	water("water", "images/water.png", Color.BLUE);
	
	private String name;
	private String defaultImageFile;
	private Color defaultColour;
	
	/**
	 * construct a new TerrainType
	 * 
	 * @param name the name of this terrain type
	 * @param defaultImage the filepath of a default image for the terrain type
	 * @param defaultColour the default colour for this terraintype
	 */
	TerrainType(String name, String defaultImageFile, Color defaultColour)
	{
		this.name = name;
		this.defaultImageFile = defaultImageFile;
		this.defaultColour = defaultColour;
	}
	
	/**
	 * @return the name of this terrain type
	 */
	public String getName()
	{
		return name;
	}
	
	/**
	 * @return a string containing a filepath to an image
	 * which may be used for this terrain type
	 */
	public String getDefaultImageFile()
	{
		return defaultImageFile;
	}
	
	/**
	 * @return the default colour used to display this terrain
	 * type.
	 */
	public Color getDefaultColour()
	{
		return defaultColour;
	}
	
	/**
	 * @return a string representation of the terrain type
	 */
	@Override
	public String toString()
	{
		return getName();
	}
}
